
public class Dog {

    private Long id;

    private String name;

    private short c;

    public Dog(Long id, String name, short c) {
        this.id = id;
        this.name = name;
        this.c = c;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public short getC() {
        return c;
    }

    public void setC(short c) {
        this.c = c;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Dog dog = (Dog) o;

        if (c != dog.c) return false;
        if (!id.equals(dog.id)) return false;
        return name.equals(dog.name);
    }

    @Override
    public int hashCode() {
        int result = id.hashCode();
        result = 31 * result + name.hashCode();
        result = 31 * result + (int) c;
        return result;
    }
}
